#include "stdafx.h"
#include "Package.h"



void EcryptionPackageV1::pack(const byte *ecryptedData, byte *initializeVector, uint64 originalDataSize, uint64 ecryptedDataSize, byte *outData)
{
    DataInfo *dataInfo = reinterpret_cast<DataInfo *>(outData);
    *dataInfo = DataInfo();

    // DataInfo
    memcpy(dataInfo->initializeVector, initializeVector, sizeof(dataInfo->initializeVector));
    dataInfo->origignalDataSize = originalDataSize;
    dataInfo->ecryptedDataSize = ecryptedDataSize;

    // Data
    memcpy(outData + sizeof(DataInfo), ecryptedData, ecryptedDataSize);
}
